﻿@model SimpleTaskManager.Domain.Entities.User

@{
    Layout = null;
}


<table class="tablesorter" id="myTasksTable">
<thead>
<tr>
    <th>Name</th>
    <th>Leader</th>
    <th>Progress</th>
    <th>Deadline</th>
    <th>Status</th>
</tr>
</thead>
<tbody>
@foreach(var t in Model.Tasks.Union(Model.LeaderOf))
{
    <tr>
        <td>@Html.ActionLink(t.Name, "Details", "Task", new { id = t.TaskID }, null)</td>
        <td>@(t.Leader.LastName + ", " + t.Leader.FirstName)</td>
        <td>@((t.Progress == null) ? "" : ((decimal)t.Progress).ToString("0.## %"))</td>
        <td>@t.EndDate.ToShortDateString()</td>
        <td>@t.Status</td>
    </tr>
}
</tbody>
</table>

<script type="text/javascript">
    $(document).ready(function () {
        $("#myTasksTable").dataTable({ bJQueryUI: true, sPaginationType: "full_numbers" });
    }
);
</script>